package com.kuangstudy.vo;

import lombok.Getter;

/**
 * @Author Melody_LQ
 * @Date 2021/6/16 9:29
 * @Description 统一 响应结果的状态码 也可以用interface来实现
 * @Since version-1.0
 */
@Getter
public enum ResultCodeEnum {

    //自定义构造函数属性值
    SUCCESS(true,20000,"成功"),
    UNKNOWN_REASON(false,20001,"未知错误"),
    BAD_SQL_GRAMMAR(false,21002,"sql语法错误"),
    PARAM_ERROR(false,21003,"参数不正确");

    private final Boolean success;
    private final Integer code;
    private final String message;

    //构造函数
    ResultCodeEnum(Boolean success,Integer code,String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

}
